﻿@model IEnumerable<CodeSaude.Application.ViewModels.LeitoViewModel>

@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<div style="margin: 0 0 10px 0; text-align: right;">
    <button class="btn btn-success btn-sm" style="font-weight: bold;" id="btnInserir"> + Novo Leito</button>
</div>

<div style="margin: 10px 0 0 0;">
    <table id="tbLeito" class="table table-bordered table-striped">
        <thead>
            <tr>
                <th>Código</th>
                <th>Nome</th>
                <th>Local Atendimento</th>
                <th>Situação</th>
                <th>Ações</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => item.LeitoId)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.NomeLeito)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => item.LocalAtendimento.NomeLocal)
                    </td>
                    <td>
                        @Html.Label("Situacao", item.Situacao, new { @class = item.ClasseCssLabelSituacao + " !important" })
                    </td>
                    <td style="width: 20%">
                        <button class="btn btn-primary btn-xs" data-title="Edit" data-id="@item.LeitoId"><span class="glyphicon glyphicon-pencil"></span>&nbsp;Editar</button>
                        <button class="btn btn-danger btn-xs" data-target="#delete-modal" data-title="Delete" data-id="@item.LeitoId"><span class="glyphicon glyphicon-trash"></span>&nbsp;Excluir</button>
                    </td>
                                </tr>
            }
        </tbody>

    </table>
    <div class="modal fade" id="modal"></div>
</div>

@Scripts.Render("~/Scripts/Entities/Leito/leito.js")


